<%@page contentType="text/html" pageEncoding="UTF-8"%>

<script>
    var actuHtml;
    var adresseAjax;
    function updateActu(){
        $.get( adresseAjax, function( data ) {
            actuHtml.html( data );
        });
    }

    $(function(){
        actuHtml = $("#filNotif");
        adresseAjax = "${pageContext.request.contextPath}/Notifications";


        window.setInterval("updateActu()", 2000);
    });
</script>

<script>
    $(function() {
        $( "#dialogNotification" ).dialog({
            autoOpen: false,
            width: 640,
            height: 480,
            show: {
                effect: "blind",
                duration: 1000
            },
            hide: {
                effect: "explode",
                duration: 1000
            }
        });
 
        $( "#openerNotif" ).click(function() {
            $( "#dialogNotification" ).dialog( "open" );
            
        });
    });
</script>

<div id="dialogNotification" titre="Notifications" title="Liste des notifications">
    <div id="filNotif">
        
    </div>
</div>



<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
        <a class="navbar-brand" href="${pageContext.request.contextPath}/listerAlbumsPublics?action=listerLesAlbumsPublics">Site Social de Photo</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Mon compte <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="${pageContext.request.contextPath}/modifierUtilisateur?action=listerInfosUtilisateur">Modifier mes informations</a></li>
            <li class="divider"></li>
            <li><a href="${pageContext.request.contextPath}/deconnexionUser?action=deconnecterUnUtilisateur">Se deconnecter</a></li>
          </ul>
        </li>
        
        <li class="active"><a href="${pageContext.request.contextPath}/Album?action=listerAlbums">Mes albums</a></li>
        <li><a href="${pageContext.request.contextPath}/Album?action=listerAlbumsPartage">Mes albums partagées</a></li>
        
        <li><a><span id="openerNotif" class="glyphicon glyphicon-bell"></span></a></li>
      </ul>
      
      
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>